<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>简单的商品信息添加</title>
    <link rel="stylesheet" href="./styles/index.css">
</head>
<body>
    <main id="main">
        <form>
            <div>
                <label>名称：</label>
                <input type="text" placeholder="请输入商品名称" v-model="goodsInfo.name">
            </div>
            <div>
                <label>价格：</label>
                <input type="number" placeholder="请输入商品价格" v-model="goodsInfo.price">
            </div>
            <div>
                <label>库存：</label>
                <input type="number" placeholder="请输入商品库存" v-model="goodsInfo.inventory">
            </div>
            <div>
                <button type="button" @click="addGoods">添加</button>
            </div>
        </form>

        <table>
            <thead>
                <tr>
                    <th>名称</th>
                    <th>价格</th>
                    <th>库存</th>
                </tr>
            </thead>
            <tbody>
                <tr v-for="goods in goodsList">
                    <td v-for="item in goods">{{item}}</td>
                </tr>
            </tbody>
        </table>
    </main>

    <script src="./plugins/vue.js"></script>
    <script src="./scripts/index.js"></script>
</body>
</html>